<%@ page session="true" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<!--
Tasks
Sexy up the next button

-->
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Choose Your Country</title>
<!--
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js">       </script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js">       </script>
-->
<script type="text/javascript" src="js/jquery-nightly.js">       </script>
<script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js">       </script>

 <link href="css/jbgallery-2.0.css" id="jbgallery-css" rel="stylesheet" media="javascript-screen" />
 <script src="js/jbgallery-2.0.js" type="text/javascript"></script>
 <link type="text/css"	href="css/submit.css" rel="stylesheet" />
 
<script type="text/javascript"><!--
	//jBGallery.Loading();
    jQuery(document).ready(function(){
		jQuery(".jbgallery").jbgallery({menu : "slider",slideshow : false});
	});
	--></script>

 <style type="text/css">
     /* z-index 1001 => jbg-content z-index 1000;*/
    #topsubmit{z-index:1001;position:absolute;left:0%;top:0%;padding:1px;display:none;}
    #botsubmit{z-index:1001;position:absolute;left:50%;top:80%;padding:1px;}
 	
     
   	</style>

</head>

<body >

<form:form modelAttribute="countryModel" method="post" name="countryform">
<div align="left" id="topsubmit">
<input type="submit" value="Select This Country" onClick="updateform()" class="xbutton" >
</div>

<div class="jbgallery" id="jbgallery">

    <ul>
        <!--  list of countries -->
             
         <c:forEach items="${countryDetailList}" var="country">
      
      <li><a title="${country.CName}" href="images/country/<c:out value="${country.cflag}"/>"><img src="images/country/<c:out value="${country.cflag}"/>" alt="<c:out value="${country.CCode}"/>" /></a>
		<div class="caption">
${country.CName}
		</div>
		</li>
	
    </c:forEach>
          </ul>
</div> 

 
<input type="hidden" name="cCode" id="cCode" />
<p align="right" id="botsubmit">
<input type="submit"  value="Select This Country" onClick="updateform()" class="xbutton" >
</p>
</form:form>


<script type="text/javascript">

function updateform()
{

var xcurrent=jQuery("#jbgallery").jbgallery("current");

var xcode =document.getElementsByTagName("img")[xcurrent];

document.countryform["cCode"].value=xcode.alt;
return true;
}
    
</script>

</body>
</html>
